package visao.usuario;

import visao.cliente.InterfaceAlterarCliente;
import visao.cliente.InterfaceCadastroCliente;
import visao.cliente.InterfaceListagemCliente;
import visao.cliente.InterfacePesquisarCliente;
import visao.funcionario.InterfaceAlterarFuncionario;
import visao.funcionario.InterfaceCadastroFuncionario;
import visao.funcionario.InterfaceListagemFuncionario;
import visao.locacao.InterfaceAlterarLocacao;
import visao.locacao.InterfaceCadastroLocacao;
import visao.tipoLocacao.InterfaceAlterarTipoLocacao;
import visao.locacao.InterfaceListagemLocacoesAbertas;
import visao.locacao.InterfaceListagemLocacoesFinalizadas;
import visao.motorista.InterfaceAlterarMotorista;
import visao.motorista.InterfaceCadastroMotorista;
import visao.motorista.InterfaceListagemMotoristas;
import visao.tipoLocacao.InterfaceCadastroTipoLocacao;
import visao.tipoLocacao.InterfaceListagemTipoLocacao;
import visao.tipoVeiculo.InterfaceAlterarTipoVeiculo;
import visao.tipoVeiculo.InterfaceCadastroTipoVeiculo;
import visao.veiculo.InterfaceAlterarVeiculo;
import visao.tipoVeiculo.InterfaceListagemTipoVeiculo;
import visao.veiculo.InterfaceCadastroVeiculo;
import visao.veiculo.InterfaceListagemVeiculoCategoria;
import visao.veiculo.InterfaceListagemVeiculos;
import visao.veiculo.InterfaceListagemVeiculosDiponiveis;
import visao.veiculo.InterfaceListagemVeiculosMaisProcurados;
import visao.veiculo.InterfaceListagemVeiculosRentaveis;
import java.awt.*;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import modelo.persistencia.ControleAcesso;
import visao.locacao.InterfaceFinalizaLocacao;


public class InterfaceMenuAdministrador extends javax.swing.JFrame {
	
	
	public InterfaceMenuAdministrador() {
		initComponents();
		
		this.setTitle("Menu Administrador");
		
		jButton1.setVisible(true);
		jButton2.setVisible(true);
		jButton3.setVisible(true);
		jButton4.setVisible(true);
		jButton5.setVisible(true);
		jButton6.setVisible(true);
		jButton7.setVisible(false);
		jButton8.setVisible(false);
		jButton9.setVisible(false);
		jButton10.setVisible(false);
		jButton11.setVisible(false);
		jButton12.setVisible(false);
		jButton13.setVisible(false);
		jButton14.setVisible(false);
		jButton15.setVisible(false);
		jFrame1.setVisible(true);
		jPanel1.setVisible(true);
		jPanel2.setVisible(true);
	}

	
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jFrame1 = new javax.swing.JFrame();
        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jButton14 = new javax.swing.JButton();
        jButton15 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();

        javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
        jFrame1.getContentPane().setLayout(jFrame1Layout);
        jFrame1Layout.setHorizontalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        jFrame1Layout.setVerticalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(212, 22, 10));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Menu", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Ubuntu Light", 0, 24))); // NOI18N
        jPanel1.setToolTipText("");
        jPanel1.setName(""); // NOI18N

        jButton1.setText("Cadastro");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonCadastroActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jButton7.setText("Cliente");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				try {
					jButton7ActionPerformed(evt);
				} catch (IOException ex) {
					Logger.getLogger(InterfaceMenuAdministrador.class.getName()).log(Level.SEVERE, null, ex);
				}
            }
        });

        jButton8.setText("Funcionário");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				try {
					jButton8ActionPerformed(evt);
				} catch (IOException ex) {
					Logger.getLogger(InterfaceMenuAdministrador.class.getName()).log(Level.SEVERE, null, ex);
				}
            }
        });

        jButton9.setText("Motorista");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				try {
					jButton9ActionPerformed(evt);
				} catch (IOException ex) {
					Logger.getLogger(InterfaceMenuAdministrador.class.getName()).log(Level.SEVERE, null, ex);
				}
            }
        });

        jButton10.setText("Veículo");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				try {
					jButton10ActionPerformed(evt);
				} catch (IOException ex) {
					Logger.getLogger(InterfaceMenuAdministrador.class.getName()).log(Level.SEVERE, null, ex);
				}
            }
        });

        jButton11.setText("Tipo Veículo");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				try {
					jButton11ActionPerformed(evt);
				} catch (IOException ex) {
					Logger.getLogger(InterfaceMenuAdministrador.class.getName()).log(Level.SEVERE, null, ex);
				}
            }
        });

        jButton12.setText("Locação");
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
				try {
					jButton12ActionPerformed(evt);
				} catch (IOException ex) {
					Logger.getLogger(InterfaceMenuAdministrador.class.getName()).log(Level.SEVERE, null, ex);
				}
            }
        });

        jButton13.setText("Tipo Locação");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        jButton14.setText("Usuários");
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });

        jButton15.setText("Outras Listagens");
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonOutrasListagensActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(43, 43, 43)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jButton11, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                                .addComponent(jButton10, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                                .addComponent(jButton9, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                                .addComponent(jButton8, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                                .addComponent(jButton12, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButton13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGap(49, 49, 49))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jButton14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                            .addComponent(jButton15, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE))
                        .addContainerGap())))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(29, Short.MAX_VALUE)
                .addComponent(jButton7)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton11)
                .addGap(12, 12, 12)
                .addComponent(jButton12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton13)
                .addGap(12, 12, 12)
                .addComponent(jButton14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton15)
                .addGap(35, 35, 35))
        );

        jButton2.setText("Consulta");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonConsultaActionPerformed(evt);
            }
        });

        jButton3.setText("Finalizar Locação");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonFinalizaLocacaoActionPerformed(evt);
            }
        });

        jButton4.setText("Alterar Dados");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAlterarDadosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
                    .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
                    .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 570, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton4)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jButton5.setText("Logoff");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLogoffActionPerformed(evt);
            }
        });

        jButton6.setText("Voltar");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVoltarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 533, Short.MAX_VALUE)
                        .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 530, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton6)
                    .addComponent(jButton5))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>

	private void jButtonCadastroActionPerformed(java.awt.event.ActionEvent evt) {                                         
		evento = 1;
		jButton1.setEnabled(true);
		jButton1.setVisible(true);
		jButton2.setEnabled(false);
		jButton2.setVisible(true);
		jButton3.setEnabled(false);
		jButton3.setVisible(true);
		jButton4.setEnabled(false);
		jButton4.setVisible(true);
		jButton5.setVisible(true);
		jButton6.setVisible(true);
		jButton7.setText("Cliente");
		jButton7.setVisible(true);
		jButton8.setText("Funcionário");
		jButton8.setVisible(true);
		jButton9.setText("Motorista");
		jButton9.setVisible(true);
		jButton10.setText("Veículo");
		jButton10.setVisible(true);
		jButton11.setText("Tipo Veículo");
		jButton11.setVisible(true);
		jButton12.setText("Locação");
		jButton12.setVisible(true);
		jButton13.setText("Tipo Locação");
		jButton13.setVisible(true);
		jButton14.setText("Usuário");
		jButton14.setVisible(true);
		jButton15.setVisible(false);
		jFrame1.setVisible(true);
		jPanel1.setVisible(true);
		jPanel2.setVisible(true);
	}                                        

	private void jButtonConsultaActionPerformed(java.awt.event.ActionEvent evt) {                                         
		evento =2;
		jButton1.setEnabled(false);
		jButton1.setVisible(true);
		jButton2.setEnabled(true);
		jButton2.setVisible(true);
		jButton3.setEnabled(false);
		jButton3.setVisible(true);
		jButton4.setEnabled(false);
		jButton4.setVisible(true);
		jButton7.setText("Pesquisar Cliente");
		jButton7.setVisible(true);
		jButton8.setText("Locações em Aberto");
		jButton8.setVisible(true);
		jButton9.setText("Locações Finalizadas");
		jButton9.setVisible(true);
		jButton10.setText("Veículos Disponíveis");
		jButton10.setVisible(true);
		jButton11.setText("Veículos mais Prourados");
		jButton11.setVisible(true);
		jButton12.setText("Veículos mais Rentáveis");
		jButton12.setVisible(true);
		jButton13.setText("Veículos por Categoria");
		jButton13.setVisible(true);
		jButton14.setText("Listagem de Usuários");
		jButton14.setVisible(true);
		jButton15.setVisible(true);
		jFrame1.setVisible(true);
		jPanel1.setVisible(true);
		jPanel2.setVisible(true);
	}                                        

	private void jButtonFinalizaLocacaoActionPerformed(java.awt.event.ActionEvent evt) {                                         
		dispose();
		new InterfaceFinalizaLocacao().setVisible(true);
	}                                        
	
	private void jButtonAlterarDadosActionPerformed(java.awt.event.ActionEvent evt) {
		evento = 3;
		jButton1.setEnabled(false);
		jButton1.setVisible(true);
		jButton2.setEnabled(false);
		jButton2.setVisible(true);
		jButton3.setEnabled(false);
		jButton3.setVisible(true);
		jButton4.setEnabled(true);
		jButton4.setVisible(true);
		jButton5.setVisible(true);
		jButton6.setVisible(true);
		jButton7.setText("Cliente");
		jButton7.setVisible(true);
		jButton8.setText("Funcionário");
		jButton8.setVisible(true);
		jButton9.setText("Motorista");
		jButton9.setVisible(true);
		jButton10.setText("Veículo");
		jButton10.setVisible(true);
		jButton11.setText("Tipo Veículo");
		jButton11.setVisible(true);
		jButton12.setText("Locação");
		jButton12.setVisible(true);
		jButton13.setText("Tipo Locação");
		jButton13.setVisible(true);
		jButton14.setText("Usuário");
		jButton14.setVisible(true);
		jButton15.setVisible(false);
		jFrame1.setVisible(true);
		jPanel1.setVisible(true);
		jPanel2.setVisible(true);
	}

	private void jButtonLogoffActionPerformed(java.awt.event.ActionEvent evt) {
		dispose();
		ControleAcesso.logoff();
	}

	private void jButtonVoltarActionPerformed(java.awt.event.ActionEvent evt) {
		jButton1.setEnabled(true);
		jButton1.setVisible(true);
		jButton2.setEnabled(true);
		jButton2.setVisible(true);
		jButton3.setEnabled(true);
		jButton3.setVisible(true);
		jButton4.setEnabled(true);
		jButton4.setVisible(true);
		jButton5.setVisible(true);
		jButton6.setVisible(true);
		jButton7.setVisible(false);
		jButton8.setVisible(false);
		jButton9.setVisible(false);
		jButton10.setVisible(false);
		jButton11.setVisible(false);
		jButton12.setVisible(false);
		jButton13.setVisible(false);
		jButton14.setVisible(false);
		jButton15.setVisible(false);
		jFrame1.setVisible(true);
		jPanel1.setVisible(true);
		jPanel2.setVisible(true);
	}
	

	private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
		if (evento == 1){
			dispose();
			new InterfaceCadastroCliente().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfacePesquisarCliente().setVisible(true);
		}else if (evento == 3){
			dispose();
			new InterfaceAlterarCliente().setVisible(true);
		}else {
			dispose();
			new InterfaceListagemCliente().setVisible(true);
		}
	}

	private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
		if (evento == 1){
			dispose();
			new InterfaceCadastroFuncionario().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfaceListagemLocacoesAbertas().setVisible(true);
		}else if (evento == 3){
			dispose();
			new InterfaceAlterarFuncionario().setVisible(true);
		}else {
			dispose();
			new InterfaceListagemMotoristas().setVisible(true);
		}
	}

	private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
		if (evento == 1){
			dispose();
			new InterfaceCadastroMotorista().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfaceListagemLocacoesFinalizadas().setVisible(true);
		}else if (evento ==3 ){
			dispose();
			new InterfaceAlterarMotorista().setVisible(true);
		}else {
			dispose();
			new InterfaceListagemFuncionario().setVisible(true);
		}
	}

	private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
		if (evento == 1){
			dispose();
			new InterfaceCadastroVeiculo().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfaceListagemVeiculosDiponiveis().setVisible(true);
		}else if (evento == 3){
			dispose();
			new InterfaceAlterarVeiculo().setVisible(true);
		}else {
			dispose();
			new InterfaceListagemVeiculos().setVisible(true);
		}
	}

	private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
		if (evento == 1){
			dispose();
			new InterfaceCadastroTipoVeiculo().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfaceListagemVeiculosMaisProcurados().setVisible(true);
		}else if (evento == 3){
			dispose();
			new InterfaceAlterarTipoVeiculo().setVisible(true);
		}else {
			dispose();
			new InterfaceListagemTipoVeiculo().setVisible(true);
		}
	}

	private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
		if (evento == 1){
			dispose();
			new InterfaceCadastroLocacao().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfaceListagemVeiculosRentaveis().setVisible(true);
		}else if(evento == 3){
			dispose();
			new InterfaceAlterarLocacao().setVisible(true);
		}else{
			dispose();
			new InterfaceListagemTipoLocacao().setVisible(true);
		}
	}

	private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {
		if (evento == 1){
			dispose();
			new InterfaceCadastroTipoLocacao().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfaceListagemVeiculoCategoria().setVisible(true);
		}else {
			dispose();
			new InterfaceAlterarTipoLocacao().setVisible(true);
		}
	}

	private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {
		if (evento == 1){
			dispose();
			new InterfaceCadastroUsuario().setVisible(true);
		}else if (evento == 2){
			dispose();
			new InterfaceListagemUsuario().setVisible(true);
		}else {
			dispose();
			new InterfaceAlterarUsuario().setVisible(true);			
		}
	}

	private void jButtonOutrasListagensActionPerformed(java.awt.event.ActionEvent evt) {
		evento = 4;
		jButton1.setEnabled(false);
		jButton1.setVisible(true);
		jButton2.setEnabled(false);
		jButton2.setVisible(true);
		jButton3.setEnabled(false);
		jButton3.setVisible(true);
		jButton4.setEnabled(false);
		jButton4.setVisible(true);
		jButton5.setVisible(true);
		jButton6.setVisible(true);
		jButton7.setText("Listagem de Clientes");
		jButton7.setVisible(true);
		jButton8.setText("Listagem de Motoristas");
		jButton8.setVisible(true);
		jButton9.setText("Listagem de Funcionários");
		jButton9.setVisible(true);
		jButton10.setText("Listagem de Veículos");
		jButton10.setVisible(true);
		jButton11.setText("Listagem de Tipos de Veículos");
		jButton11.setVisible(true);
		jButton12.setText("Listagem de Tipos de Locações");
		jButton12.setVisible(true);
		jButton13.setVisible(false);
		jButton14.setVisible(false);
		jButton15.setVisible(false);
		jFrame1.setVisible(true);
		jPanel1.setVisible(true);
		jPanel2.setVisible(true);
	}
	
	
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JFrame jFrame1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private int evento;
}
